<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2018/1/10
 * Time: 10:54
 * 清楚缓存
 */
//后台登陆控制
include_once('admin_global.php');
$db->Get_user_shell_check($uid, $shell);   //检测用户是否登录

include_once('../common/smarty/Smarty.class.php');    //加载Smarty类文件
//实例化Smarty，并配置Smarty参数
$smarty = new Smarty();
$smarty->clearAllCache();     //清除所有的缓存
//删除缓存文件
$dirname = '../cache/';  //放缓存的文件夹
if (is_dir($dirname)) {
    $handle = opendir($dirname);
    $num = 0;
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
            @unlink($dirname . '/' . $file);
            $num++;
        }
    }
}
echo "<script>alert('清除成功！');window.location.href='right.php';</script>";